import request from '@/axios'
import type { ListParams, Response } from '@/api/api'

export interface Row {
  id?: number
  name: String
  real_name: string
  mobile: string
  address: string
  type: string
  province_id: string
  city_id: string
  area_id: string
  abbreviation: string
}

// 第三方列表
export const getListApi = (data: ListParams): Promise<Response<Row>> => {
  return request.post({ url: '/supplier/list', data })
}
// 新增
export const createApi = (data: Partial<Row>): Promise<IResponse> => {
  return request.post({ url: '/supplier/create', data })
}
// 修改
export const modifyApi = (data: Partial<Row>): Promise<IResponse> => {
  return request.post({ url: '/supplier/modify', data })
}
// 删除
export const delApi = (data: { id: string }): Promise<IResponse> => {
  return request.post({ url: '/supplier/del', data })
}
